#!/bin/bash
arr=(dim_aml_account.sql dim_aml_customer.sql dim_aml_rule.sql dim_aml_watchlist.sql fact_aml_alert.sql fact_aml_screening.sql fact_aml_str_report.sql fact_aml_transaction.sql)
for sql in ${arr[@]} do
hive -hiveconf hive.exec.mode.local.auto=true  -f "$sql"
hive -hivevar dt="`date -d '-1 days' +"%Y-%m-%d"`" -f "$sql"
hive -f /aml/dwd/"$sql"
text=awk -f'.' '{print,$1}' "$sql"
echo "正在执行${text}的更新"
/aml/dwd/update_dwd.sh >> /aml/dwd/${text}_`date+"%y%m%d"`.log 2>&1 &
done
